home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / sysdeps / unix / bsd / osf1 / alpha / sysdep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-18  |  2.0 KB  |  69 lines

  1. /* Copyright (C) 1993 Free Software Foundation, Inc.
  2.    Contributed by Brendan Kehoe (brendan@zen.org).
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. #include <sysdeps/unix/sysdep.h>
  20. #include <machine/pal.h>        /* get PAL_callsys */
  21. #include <regdef.h>
  22.  
  23. #ifdef __STDC__
  24. #define ENTRY(name) \
  25.   .globl name;                                      \
  26.   .ent name,0;                                      \
  27.   name##:;                                      \
  28.   .frame sp,0,ra
  29. #else
  30. #define ENTRY(name) \
  31.   .globl name;                                      \
  32.   .ent name,0;                                      \
  33.   name/**/:;                                      \
  34.   .frame sp,0,ra
  35. #endif
  36.  
  37. #ifdef __STDC__
  38. #define PSEUDO(name, syscall_name, args) \
  39.   ENTRY(name);                                      \
  40.   ldiq v0, SYS_##syscall_name;                              \
  41.   .set noat;                                          \
  42.   call_pal PAL_callsys;                                  \
  43.   .set at;                                          \
  44.   beq a3, 10f;                                      \
  45.   br gp, 20f;                                      \
  46. 20:;                                          \
  47.   ldgp gp, 0(gp);                                  \
  48.   jmp zero, syscall_error;                              \
  49. 10:
  50. #else
  51. #define PSEUDO(name, syscall_name, args) \
  52.   ENTRY(name);                                      \
  53.   ldiq v0, SYS_/**/syscall_name;                          \
  54.   .set noat;                                          \
  55.   call_pal PAL_callsys;                                  \
  56.   .set at;                                          \
  57.   beq a3, 10f;                                      \
  58.   br gp, 20f;                                      \
  59. 20:;                                          \
  60.   ldgp gp, 0(gp);                                  \
  61.   jmp zero, syscall_error;                              \
  62. 10:
  63. #endif
  64.  
  65. #define ret        ret zero,(ra),1
  66. #define r0        v0
  67. #define r1        a4
  68. #define MOVE(x,y)    mov x, y
  69.